/**
*      author: Y_Yao
*      created: 2025-03-22 20:57:28
**/

#include<bits/stdc++.h>

#define int LL
using namespace std;
using LL = long long;
const LL LLINF = 9e18;
const int INF = 0x3f3f3f3f;
string s;

void solve()
{
    cin >> s;
    if(s.size() == 1)
    {
        cout << s << endl;
        return;
    }
    int r = s.size() - 1;
    int l = 0;
    int left = -1;
    while(l < r)
    {
        if(s[l] != s[r])
        {
            l++;
            continue;
        }
        int ml = l,mr = r;
        while(s[ml] == s[mr] && ml < mr)
        {
            ml++,mr--;
        }
        if(ml < mr)
        {
            l++;
            continue;
            //l = ml,r = s.size() - 1;
        }
        // else if(ml == mr)
        // {
        //     left = l - 1;
        //     break;
        // }
        else 
        {
            left = l;
            break;
        }
    }
    //cout << left;
    if(left == -1)
    {
        left = s.size() - 1;
    }
    for(int i = left - 1;i >= 0;i--)
    {
        s.push_back(s[i]);
    }
    cout << s << endl;
    
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int t = 1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}